//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
  // 登录一级路由
  {
    path: '/login',
    component: () => import('@/view/Login/index.vue'),
    name: 'login', //命名路由
    meta: {
      title: '登录',
      hidden: true, //标识该路由在菜单隐藏
    },
  },
  // NotFound404一级路由
  {
    path: '/NotFound404',
    component: () => import('@/view/NotFount404/index.vue'),
    name: 'NotFound404',
    meta: {
      title: 'NotFound404',
      hidden: true, //标识该路由在菜单隐藏
    },
  },
  // layout首页一级路由
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '', //菜单标题
      hidden: false, //标识该路由在菜单隐藏
      icon: '',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/view/Home/index.vue'),
        meta: {
          title: '首页',
          hidden: false, //标识该路由在菜单隐藏
          icon: 'HomeFilled',
        },
      },
    ],
  },
  // 数据大屏一级路由
  {
    path: '/screen',
    component: () => import('@/view/Screen/index.vue'),
    name: 'Screen',
    meta: {
      hidden: false,
      title: '数据大屏',
      icon: 'Platform',
    },
  },
]

// 异步路由
export const asyncRoute = [
  // 权限管理
  {
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    name: 'Acl',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'Lock',
    },
    redirect: '/acl/permission',
    children: [
      {
        path: '/acl/user',
        component: () => import('@/view/Acl/User/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          hidden: false, //标识该路由在菜单隐藏
          icon: 'User',
        },
      },
      {
        path: '/acl/role',
        component: () => import('@/view/Acl/Role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          hidden: false, //标识该路由在菜单隐藏
          icon: 'UserFilled',
        },
      },
      {
        path: '/acl/permission',
        component: () => import('@/view/Acl/Permission/index.vue'),
        name: 'Permission',
        meta: {
          title: '菜单管理',
          hidden: false, //标识该路由在菜单隐藏
          icon: 'Monitor',
        },
      },
    ],
  },
  // 商品管理路由
  {
    path: '/product',
    component: () => import('@/layout/index.vue'),
    name: 'Product',
    meta: {
      title: '商品管理',
      hidden: false, //标识该路由在菜单隐藏
      icon: 'Goods',
    },
    redirect: '/product/trademark',
    children: [
      {
        path: '/product/trademark',
        component: () => import('@/view/product/TradeMark/index.vue'),
        name: 'TradeMark',
        meta: {
          title: '品牌管理',
          icon: 'ShoppingCartFull',
        },
      },
      {
        path: '/product/attr',
        component: () => import('@/view/product/Attr/index.vue'),
        name: 'Attr',
        meta: {
          title: '属性管理',
          icon: 'ChromeFilled',
        },
      },
      {
        path: '/product/spu',
        component: () => import('@/view/product/Spu/index.vue'),
        name: 'Trademark',
        meta: {
          title: 'SPU管理',
          icon: 'Calendar',
        },
      },
      {
        path: '/product/sku',
        component: () => import('@/view/product/Sku/index.vue'),
        name: 'Sku',
        meta: {
          title: 'SKU管理',
          icon: 'Orange',
          hidden: false, //标识该路由在菜单隐藏
        },
      },
    ],
  },
]

// 其他路由
export const anyRoute = [
  // 以上都没有匹配成功
  {
    path: '/:pathMatch(.*)*',
    redirect: '/NotFound404',
    name: 'Any',
    meta: {
      title: '其他路由',
      hidden: true, //标识该路由在菜单隐藏
      icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
    },
  },
]
